<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                template="./../template/templateMenu.xhtml"
                xmlns:p="http://primefaces.org/ui"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core">

    <ui:define name="conteudo">
        <h:form>
            <p:panel header="Discos do Albúm #{discoBean.album.nomeAlbum}"  style="width: auto; height: auto; font-style: normal; font-size: 12px">
                <p:messages id="messages" showDetail="true" /> 
                <p:dataTable id="dtDisco" var="disco" value="#{discoBean.discos}"
                             paginator="true" rows="15"
                             style="width: auto; height: auto"
                             emptyMessage="Sem Registros">
                    <p:column headerText="Nome ">
                        <h:outputText value="#{disco.nomeDisco}"/>
                    </p:column>
                    <p:column headerText="Disco Número ">
                        <h:outputText value="#{disco.num}"/>
                    </p:column>
                    <p:column width="60">
                        <f:facet name="header">  
                            <h:outputText value="Opções"/>  
                        </f:facet> 
                        <p:commandButton ajax="false" 
                                         value="Abrir Disco" 
                                         action="#{discoBean.irMusicas}">

                            <f:setPropertyActionListener 
                                target="#{musicaBean.disco}" 
                                value="#{disco}"/>
                        </p:commandButton>
<!--                        <p:commandButton ajax="false" 
                                         value="Excluir Disco" 
                                         action="#{discoBean.irMusicas}">

                            <f:setPropertyActionListener 
                                target="#{discoBean.disco}" 
                                value="#{disco}"/>
                        </p:commandButton>-->
                    </p:column>
                </p:dataTable>
            </p:panel>
            <div align="south">
                <h:panelGrid columns="6">
                    <p:commandButton value="Cadastrar Novo Disco" ajax="false" action="#{discoBean.irCadastroDisco}">
                    </p:commandButton>
                </h:panelGrid>
            </div>
        </h:form>
    </ui:define>

</ui:composition>
